<#assign us = fn.service('loginUser')>
<#assign changePwdLink = fn.jsLink('/espirit/eap/sa/loginUser._changePassword','','_popupTab_Change Password')>

<div class="leftMenu">
<div class="pane-header">
	<#assign user = us.loginUser!>
	${user.name!}
</div>

<div class="jleftmenuback"></div>
<div id="leftMenu" class="jleftmenu">

<#assign menuData=fn.service('espirit.eap.manager.menu').searchMenuList(2)>
<#list menuData as menuItem>
	<h3><@i18n name=menuItem.text/></h3>

	<div>
		<ul>
	<#list menuItem.children as childItem>
		<#if childItem.href??>
			<li><a href="javascript:void(0)" onclick="selectMenu(this,'${childItem.href}','${childItem.i18n!}','${childItem.text}')">${childItem.text}</a></li>
		<#else>
			<#list childItem.children as subChildItem>
				<li><a href="javascript:void(0)" onclick="selectMenu(this,'${subChildItem.href!''}','${subChildItem.i18n!''}','${subChildItem.text}')">${subChildItem.text}</a></li>
			</#list>
		</#if>
	</#list>
		</ul>
	</div>
</#list>

	<h3><@i18n name="用户"/></h3>
	<div>
		<ul>
			<#assign languages = fn.service('i18n').languages>
			<#list languages as language>
				<#assign fieldI18nKey = fn.service('model').getModelFieldI18nKey('espirit.eap.manager.i18n', language + 'Name')>
				<#if fieldI18nKey != ''>
					<li><a href='${fn.link('/index')}?request_locale=${language}'><@i18n name=fieldI18nKey locale=language/></a></li>
				</#if>
			</#list>
			<li><a id="_changePassword" href="javascript:void(0)" onclick="openMainTab('${fn.link('/espirit/eap/sa/loginUser._changePassword.html')}','<@i18n name='更改密码'/>','action.changePassword');void(0);"><@i18n name="更改密码"/></a></li>
			<li><a href='${fn.link('/espirit/eap/sa/loginUser.logout')}'><@i18n name="退出登录"/></a></li>
		</ul>
	</div>
</div>
<script>
when('initIndexPage', '$.fn.accordion', function(){
	$('#leftMenu').show().accordion({
		collapsible: true,
		autoHeight: false,
		fillSpace: false
	});
	<#assign hasPermission = us.hasLinkPermission(fn.linkNoBase('/espirit/eap/pagelayout/page._add',true), false)>
	initIndexPage(false, ${hasPermission?string});
});
</script>
</div>

<@inject name='container.jui' point='header' type='html' priority=2 once=true>
	<@css src="/static/espirit/styles/jquery-ui-1.8.18.custom.css"/>
	<@script src="/static/espirit/scripts/jquery-ui-1.8.18.custom.js"/>
</@inject>